Applets were crashing because of callback procedures being improperly wrapped as UniversalProcPtrs. This fixed most problems with crashing applets.
Folder Actions terminology for the "to" parameter did not compile because of the use of TightBindingFunction in the terminology definition. This has been fixed.
The osax/osiz mechanism was changed to allow heterogeneous osiz settings in one file and to mix native and 68K osax in the same file. If there is no osiz resource in an osax file, it is assumed to have its osax code in osax resources in the resource fork, with default osiz flags. If there is exactly one osiz resource, the osiz bits control the operation of all osaxen in that file as documented in AppleScript Scripting Additions p. 89; in addition, bit 4 controls whether the osaxen can be found in the resource fork or as symbols in the shared library in the data fork (see the notes for a3).
If there is more than one osiz resource, then each osiz resource controls a separate osax code segment of the resource name or fragment symbol name that matches the name of the osiz resource. For example, an osax could have one 68K based osax "AEVTofoobark" in its resource fork that accepts remote events and one PPC based osax "AEVTofoobazf" as a symbol in the code fragment in the data fork that does not accept remote events. There would be two osiz resources, one "AEVTofoobark" with the acceptRemoteEvents and osaxCodeInResources bits declared, and one "AEVTofoobazf" with the dontAcceptRemoteEvents and osaxCodeInSharedLibraries bits declared.
The resource number of the osiz is ignored, and any resources or symbols that do not have a correspondingly-named osiz resource are also ignored. Underscore characters found in the osiz resource name map to underscores in the symbol name, but are converted to spaces when installed in the event handler; so the event with suite "syso" and code 'gmt ' has a symbol and osiz name "AEVTsysogmt_".
The Folder Actions menu items are now displayed only when the contectual menu is invoked over a Finder folder.
A crash when recording for the second time has been fixed.
The Scripting Components and Internet Scripting scripting additions were merged into the Standard Additions file. The Choose from List scripting addition was added to the Standard Additions file. Its terminology is:
choose from list: allows user to select an item from a list |
choose from list list -- the list of items to choose from |
[prompt string] -- prompt placed at the top of the list selection dialog |
[at x position small integer] -- the horizontal position of the dialog |
[at y position small integer] -- the vertical position of the dialog |
[multiple selections boolean] -- allow multiple items to be selected? |
[ok button string] -- name of the ok button |
[cancel button string] -- name of the cancel button |
[empty lists boolean] -- can the user make no selection and then choose ok? |
[initially select list] -- list of items to initially select |
Result: list -- the list of items chosen |
Ten Folder Actions scripts are included in this build. They are installed in the Folder Actions folder in the Scripts folder in the System folder. Their names and functions are:
Add * Duplicate to folders |
When items are dropped into a folder, they are automatically copied to other folders whose aliases are in that folder with a given prefix. |
Add * New item alert w/dialog |
Displays an alert dialog when files are added to a folder. |
Add * Reject added items |
Moves any added items to a "Rejected Items" folder on the Desktop. |
Add * Set view prefs to match |
Sets the Views preferences of all child folders to the same as the parent. |
Close * Close sub-folders |
When this folder is closed, any open subfolders are also closed. |
Close * Keep folder open |
When this folder is closed, it reopens (so Folder Actions can keep happening) |
Move * Align open sub-folders |
When this folder is moved, open windows of its subfolders are moved the same amount. |
Open * Open items labeled 1 |
When this folder is opened, all items labeled with the first label (default orange, "Essential") are automatically opened. |
Open * Show comments in dialog |
When this folder is opened, the folder comments from the Get Info box are displayed in a dialog box. |
AppleScript Gestalt and Component versions now correct. Interface is 1.1, implementation is 1.3.
A memory leak in Run Script was fixed.
A failure to restore the resource chain in Store Script caused an applet's CODE 0 resource to be loaded into the application heap. This has been fixed.
Choose File's resource name catches all 'syso' events. In fact, both Choose File and Choose Folder were omitted from d22, and a bug prevented the last handler in Standard Additions from being seen anyway. (Additionally, an error in checking in code prevented any standard additions from working at all, so there.)
Read/Write Commands reads lists of lists incorrectly. In fact, all read/write commands were omitted from d22. Fixed this problem and added Read/Write commands to Standard Additions.
Displaying certain large, nested, or recursive lists could cause a crash. This has been fixed by adding processor stack checks along with the GC stack checks.
Applets would previously fail to send a second AppleEvent and receive a null reply for it, due to a combination of three separate problems. This in combination with another yet-unfixed bug would cause a crash when running just about any applet. This has now been fixed so that applets that run without error do not crash.
The Store Script scripting addition left its resource fork open, so subsequent calls to the Resource Manager would occasionally load resources from AppleScript into the current application's heap, often bringing in such fun ones as CODE 0. Now Store Script closes its resource file after use.
Several scripting additions that had been inadvertantly omitted in d22 have been added: Clipboard, Read/Write Commands, Scripting Components (RADAR 2223653),
AGStart scripting addition integrated into Standard Additions. Note that this does not expose terminology.
The Clipboard scripting addition from Jon's Commands was integrated into the Standard Additions. The terminology is as follows:
clipboard info: Get information about the clipboard. |
clipboard info |
[for type class] -- The data type about which information is requested. |
Result: list -- A list of lists of data type & size. |
set the clipboard to: Place data on clipboard. |
set the clipboard to anything -- The data to place on the clipboard. |
the clipboard: Get value of clipboard. |
the clipboard |
[as type class] -- The type of data desired. |
Result: anything -- The data from the clipboard. |
Class picture: A picture object. |
Class sound: A sound object. |
Folder Actions is now itself scriptable. The terminology is as follows:
Folder Actions Control Suite: |
Terms to control Folder Actions |
attach action to: Attach an action to a folder |
attach action to alias -- The folder to attach the action to |
[using alias] -- A file containing the script to attach |
remove action from: Attach an action to a folder |
remove action from alias -- The folder to remove the action from |
[action number integer] -- The index number of the action to remove |
edit action of: Attach an action to a folder |
edit action of alias -- The folder to edit the action of |
[action number integer] -- The index number of the action to edit |
An additional scripting addition command, MountVolume, has been added to Standard Additions. The terminology is preliminary and will be changed in the future to match the Connectivity Suite.
mount volume: Mounts the specified AppleShare volume. |
mount volume |
volume string -- The volume to mount. |
server string -- The server on which the volume resides. |
[AppleTalk string alias] -- The zone in which the server resides. |
[user name string] -- The username with which to mount the volume. |
[user password string] -- The password of the user. |
Result: string -- An error message, or an empty string if successful. |
Folder Actions are scripts attached to folders in the Finder. When a user acts on a visible folder, the Finder calls a handler in the script. For example, you could have a script send email when the contents of a folder change, or when one folder is opened, automatically open several others and "tile" the folders to appear together on the screen.
A contextual menu plug-in (activated by holding down the Control key while pressing on a folder in the Finder) controls Folder Actions. This menu has three options:
Attach a Folder Action: brings up a standard file dialog to choose a script, then attaches that script to the folder. The script is not affected; the Finder simply remembers a reference to it (an alias, in fact). Many folders can share the same action script, and if you change the script, every folder using that script will exhibit the new behavior.
Remove a Folder Action: Only visible when a folder has actions attached to it. Shows a hierarchical menu with all attached actions, and lets you remove the action. The script itself is not changed; removing a folder action simply means that action will not take place when that folder is manipulated in the Finder.
Edit a Folder Action: Only visible when a folder has actions attached to it. Shows a hierarchical menu with all attached actions, and lets you edit the action script. Note that if other folders share this action, those folder actions will be affected as well.
When one or more actions are attached to a folder, it's displayed in the Finder with a script badge, which is visible both on the folder's icon and in the title bar of the window when it's opened. Whenever a folder is badged, the Finder will call every action attached to it every time the folder is opened, closed, has its window moved, has new items added to it, or has items removed from it.
Note that for the latter two, this is only true when the changes would be visible to the user: that is, when the folder is either opened into a window, or has its turn-down arrow turned down in a list view of its containing folders. If a folder's contents are not visible (the folder window is closed and not turned down in any list view), the Finder will not call any Folder Actions.
When the Finder calls a folder action, it calls a specific handler in each action depending on what the action was. The Standard Additions file has the terminology that the Finder uses to communicate with Folder Actions; this terminology determines the scripts you can write to respond to those actions.
Folder Actions Suite: |
Terms for Folder Actions handlers. These events are sent to your folder action scripts. |
opened folder: Called after a folder has been opened into a window. |
opened folder alias -- Folder that was opened. |
closed folder: Called after a folder has been opened into a window. |
closed folder alias -- Folder that was closed. |
moved folder window: Called after a folder window has been moved or resized. |
moved folder window alias -- Folder whose window was moved or resized. |
to bounding rectangle -- New coordinates of folder window. |
added folder items: Called after new items have been added to a folder whose contents are visible. |
added folder items alias -- Folder receiving the new items. |
to alias -- Items the folder received. |
moved folder window: Called after items have been removed from a folder whose contents are visible. |
removed folder items alias -- Folder losing the items. |
to alias -- Items the folder lost. For permanently deleted items, only the names (in strings) are provided. |
Note: The "Run" handler (or any statements outside of a handler block) are executed first for every script, then the designated handler.
This terminology is Alpha and will change. Terminology will be frozen at Beta.
For the added folder items and removed folder items commands, the additional parameter is a list of aliases to the items gained or lost. In the case of items removed, those items that were moved elsewhere (including the Trash) will have aliases representing them, and those items lost altogether (such as items that had to be deleted immediately, were deleted behind the Finder's back, or that were replaced by others) will be represented by strings containing the file name.
Instead of many individual scripting additions, the following scripting additions have been consolidated into the "Standard Additions" scripting addition:
The interface and functionality of these is unchanged from version 1.1.2.
Several new scripting addition commands are added:
delay: Delay for a fixed amount of time |
delay integer -- number of seconds to delay |
Waits for a given number of seconds. You can write delay 5*minutes or use the other built-in time multipliers if you choose. The cursor does not spin during a delay, and mouse clciks will not change to other applications, but background tasks do get time.
say: Speak the given text |
say anything -- The text to speak |
[using string] -- The voice to speak with |
[display anything] -- The text to display in the feedback window (if different) |
If PlainTalk Text To Speech is installed and enabled, this command speaks the given text. The text can be encoded using the modifiers that change the intonation and interpretation of the text; see the Text to Speech documentation. The optional parameter using is the name of a voice in the Voices folder with which to speak. If Speech Recognition is installed and enabled, the text spoken is also shown in the Speech Recognition window; the optional parameter display allows you to supply alternate text in case the main text is encoded with intonation characters.
summarize: Summarize the specified string or file |
summarize anything -- the specified string or file |
[in integer] -- Specifies number of sentences desired in the summary |
Result: string -- the summary string |
If Find by Content is installed, summarizes the given text (either as an alias or text string) into the number of sentences provided in the required second parameter.
This version introduces the type Unicode text. Its basic structure is a stream of Unicode text. It can be coerced to and from the normal typeText, typeStyledText, and typeIntlText.
This version introduces a concept of units of measurement, and some basic units. Applications or OSAXen can extend these easily; more details on this will be forthcoming in future notes. The types defined so far are:
The basic manner of use is by coercion, e.g. "5 as inches". A value of one class can be coerced into another similar class, such as "5 as feet as inches", so long as both classes share a common base unit (in this case meters).
To display these properly, we also add a global Get Data handler to handle requests on object specifiers and coerce them to values.
New suites for Internet data types and Macintosh connectivity are now included in the 'aeut' resource.
AppleScript now requires AppleEvent Manager 1.0.5, with a private selector for an internal routine. For systems that lack this version, the version inside AppleScript that is installed if the PACK 8-based AppleEvent manager is not present has been updated to 1.0.5. Note that on Allegro d12c2 the version of PACK 8 is 1.0.4, and AppleScript cannot replace it when it's in the System file. Future versions of the System File will ahve AEM 1.0.5 to obviate the problem.